package com.branches.threads;


public class Producer implements Runnable {

    private Container container;

    public Producer(Container container) {
        this.container = container;
    }

    @Override
    public void run() {
        while(true) {
            int idx = this.container.getIndex();
            Product p = new Product(idx);
            this.container.put(p);
        }
    }
}
